#!/usr/bin/env groovy
import javax.swing.*
import static java.lang.System.*
import static java.util.Date.*
import static javax.swing.JOptionPane.*

def jEdit = Class.forName("org.gjt.sp.jedit.jEdit")
def fileChooser = new JFileChooser(getProperty("user.home") + "/Desktop")
fileChooser.fileSelectionMode = JFileChooser.FILES_ONLY
if (fileChooser.showOpenDialog() != JFileChooser.APPROVE_OPTION)
    return;
def propsFile = fileChooser.selectedFile

jEdit.newFile(view).insert(0, propsFile.readLines().findAll{
    it =~ /.*shortcut=.*/
}.sort().collect{
    it
}.join("\n"))

